ipType : "IPv4", // right now, either IPv4 or IPv6
keepAliveMode : true, // keep the connection alive with NOOP's
networkTimeout : 30, // how many seconds b/f we consider the connection to be stale and dead
proxyHost : "",
proxyPort : 0,
proxyType : "",
activePortMode : false, // in active mode, if you want to specify a range of ports
activeLow : 1, // low port
activeHigh : 65535, // high port
reconnectAttempts : 40, // how many times we should try reconnecting
reconnectInterval : 10, // number of seconds in b/w reconnect attempts
reconnectMode : true, // true if we want to attempt reconnecting
sessionsMode : true, // true if we're caching directory data
timestampsMode : false, // true if we try to keep timestamps in sync
useCompression : true, // true if we try to do compression
integrityMode : true, // true if we try to do integrity checks
errorConnectStr : "Unable to make a connection. Please try again.", // set to error msg that you'd like to show for a connection error
errorXCheckFail : "The transfer of this file was unsuccessful and resulted in a corrupted file. It is recommended to restart this transfer.", // an integrity check failure
passNotShown : "(password not shown)", // set to text you'd like to show in place of password
l10nMonths : new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"), // used in display localized months
// end: variables you can set
// variables used internally
isConnected : false, // are we connected?
isReady : false, // are we busy writing/reading the control socket?
isReconnecting : false, // are we attempting a reconnect?
legitClose : true, // are we the ones initiating the close or is it a network error
reconnectsLeft : 0, // how many times more to try reconnecting
networkTimeoutID : 0, // a counter increasing with each read and write
transferID : 0, // a counter increasing with each transfer
queueID : 0, // another counter increasing with each transfer
controlTransport : null,
controlInstream : null,
controlOutstream : null,
pipeTransport : null, // SFTP stuff
ipcBuffer : null,
isKilling : false,
readPoller : 0,
doingCmdBatch : false,
dataSocket : null,
activeCurrentPort : -1, // if user specified a range of ports, this is the current port we're using
featMLSD : false, // is the MLSD command available?
featMDTM : false, // is the MDTM command available?
featXMD5 : false, // is the XMD5 command available?
featXSHA1 : false, // is the XSHA1 command available?
featXCheck : null, // are the XMD5 or XSHA1 commands available; if so, which one to use?
featModeZ : false, // is the MODE Z command available?
welcomeMessage : "", // hello world
fullBuffer : "", // full response of control socket
connectedHost : "", // name of the host we connect to plus username
localRefreshLater : '',
remoteRefreshLater : '',
waitToRefresh : false,
transferMode : "", // either "A" or "I"
securityMode : "", // either "P" or "C" or ""
compressMode : "S", // either "S" or "Z"
currentWorkingDir : "", // directory that we're currently, uh, working with
version : "1.0.7", // version of this class - used to avoid collisions in cache
remoteMonths : "Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec", // used in parsing months from list data
let tmpFile = Components.classes["@mozilla.org/file/directory_service;1"].createInstance(Components.interfaces.nsIProperties).get("TmpD", Components.interfaces.nsILocalFile);
tmpFile.append(count + '-blankFile');
while (tmpFile.exists()) {
++count;
tmpFile.leafName = count + '-blankFile';
}
var foutstream = Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);